package auto.utils;

import auto.base.TestNgSpringContextTests;
import com.google.common.collect.Maps;
import com.kipa.http.service.impl.HttpServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author 马伟龙（weilong.ma@yummy.tech）
 * @since 2021年05月17日
 */

@Service
public class LoginService extends TestNgSpringContextTests {

    @Autowired
    public HttpServiceImpl httpServiceImpl;
    private String username = busiMap.get("user.username");
    private String password = busiMap.get("user.password");

    public void login() {
        Map<String, String> paramMap = Maps.newHashMap();
        paramMap.put("username", username);
        paramMap.put("password", password);
        paramMap.put("execution", "9a9b0c50-4727-476e-9af4-708140ab36e1_ZXlKaGJHY2lPaUpJVXpVeE1pSjkuM3QxdWJPbFVVVjBCS3hqL1VEbVdiakJ0TzN2dnE5NEVPbUp1SDVBcjRDRGRvY2tQYURWZndQbUNJeXZXUVNLdTE3dzZXdW5Wc0didHBiU0dJajNKTjRrOW5kd3lYRFV5cW4wZGRqand1aUFTTTVrdHRLeW0zTlpxTmRFamF3L2syQzd0TkZKVHBXbTlIMlN3QXZCNW9zRGx2RTFCWG52dDJGdzFUK25QTFNYZHNLNnFRYnFIQkdjdDVUNExXVEVNRWttYllUZVFZQmVNTHJJTEVhTmIyYVZBNlpaWEdsSENhWm9Gekl6N3FrazR1QzhjYnA3WTF4bzd5Kzd5c0IyNzIxUFA1VXVEUVFmSENkVmlHVVVydmdtVEdpNksyV253SFJFK01iZ0MrZTgvRWpIbzZxbXRZV2ZQT2dBN2UvTVg3UjV1MmIrSTNPM0JJWDdFS2l1Uld0akF5ZGxHMVBkVDFmbzFjd3FwOFhqVm5iVGc1eitSbjdoWDVMZzhzSVp6UGREZEVuWHJZQXk5VkpXeU9xV1BnbWIwZ0VOVlYvSU5XTDgwc3YvQkM4UG0wS0JpT2dkcEZUdEtDUFpsSmR6N3lDcVpqUHV3YW4zWlJMVEhQL1dVRnQvZXRZbGNIMUVBV1lVOW5obmtpSE1VVTdmcnBtaXhyd29hME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bWsza3duTHJ6OTJVcTUwbXN5Y3gzUkxuNGx0bDR0cGxmMmc5UGNVV3lDZVBYdGt2RkhpWVFjekd5Yk1PQnBqVnNHa1pOcEVKWEFyTWkvUWZ2M3dOenBhUWJ1L0d0SmVhdlhtZGhTMXVXMXBGSHA2dXZ0aCtEa01GNzViSm9USHNMcTYxTDlBM0ZEck5NbDFtdHlBbVNZV0UxM1NZMmJ2d0t6OWVmWG53R1hCZ0pKakp3L0pHN3pVLldaWlpZUktqRGF5MlZWYVpwdS1PeG50a3g0YXQ5c213Tm8zZjhGTDFCOTFxT2c5eFFja3dJck1aV0tTbkd4RUdMQnl2NGFJNnd3Y2xLdTR3NFNCbjRR");
        paramMap.put("_eventId", "submit");
        httpServiceImpl.post("http://ssotest1.yummy.tech/sso/login", paramMap);
    }
}
